<?php
class ControllerModuleLogin extends Controller { 
	protected function index() {
		if ($this->customer->isLogged()) {  
      		//$this->redirect(HTTPS_SERVER . 'index.php?route=account/account');
      		$this->data['status'] = '1';
      		$this->data['account'] = HTTPS_SERVER . 'index.php?route=account/account';
      		$this->data['password'] = HTTPS_SERVER . 'index.php?route=account/password';
      		$this->data['order'] = HTTPS_SERVER . 'index.php?route=account/history';
      		$this->data['logout'] = HTTPS_SERVER . 'index.php?route=account/logout';
      		$this->data['name'] = $this->customer->getName();
    	}else{
    		$this->data['action'] = HTTPS_SERVER . 'index.php?route=account/login';
    		$this->data['status'] = '0';
    	}
		$this->id = 'login';
		
		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/login.tpl')) {
			$this->template = $this->config->get('config_template') . '/template/module/login.tpl';
		} else {
			$this->template = 'default/template/module/login.tpl';
		}
		
		$this->render();
	}
}